fclose(f);
return -1;
}
-
+
p = line;
while (fgets(line, sizeof(line), f))
{
if (cursors[i].builtin)
return LoadCursor (NULL, cursors[i].builtin);
}
-
+
w = GetSystemMetrics (SM_CXCURSOR);
h = GetSystemMetrics (SM_CYCURSOR);
{
ofs = (y * w) / 8;
j = y * cursors[i].width;
-
+
for (x = 0; x < cursors[i].width && x < w ; x++, j++)
{
gint pofs = ofs + x / 8;
guchar data = (cursors[i].data[j/4] & (0xc0 >> (2 * (j%4)))) >> (2 * (3 - (j%4)));
gint bit = 7 - (j % cursors[i].width) % 8;
-
+
if (data)
{
RESET_BIT (and_plane[pofs], bit);
WIN32_API_FAILED ("CreateCursor");
g_free (and_plane);
g_free (xor_plane);
-
+
return rv;
}
{ "wait", IDC_WAIT }
};
-GdkCursor*
+GdkCursor*
_gdk_win32_display_get_cursor_for_name (GdkDisplay *display,
const gchar *name)
{
/* Colour cursor */
gboolean no_alpha;
-
+
if (!GDI_CALL (GetDIBits, (hdc, ii.hbmColor, 0, 1, NULL, (BITMAPINFO *)&bmi, DIB_RGB_COLORS)))
goto out1;
bmi.bi.biHeight = -h;
bits = g_malloc0 (4 * w * h);
-
+
/* color data */
if (!GDI_CALL (GetDIBits, (hdc, ii.hbmColor, 0, h, bits, (BITMAPINFO *)&bmi, DIB_RGB_COLORS)))
goto out2;
w = bmi.bi.biWidth;
h = ABS (bmi.bi.biHeight) / 2;
-
+
bits = g_malloc0 (4 * w * h);
-
+
/* masks */
if (!GDI_CALL (GetDIBits, (hdc, ii.hbmMask, 0, h*2, bits, (BITMAPINFO *)&bmi, DIB_RGB_COLORS)))
goto out2;
return TRUE;
}
-gboolean
+gboolean
_gdk_win32_display_supports_cursor_color (GdkDisplay *display)
{
g_return_val_if_fail (display == _gdk_display, FALSE);
*height = GetSystemMetrics (SM_CYCURSOR);
}
-void
+void
_gdk_win32_display_get_maximal_cursor_size (GdkDisplay *display,
guint *width,
guint *height)
{
g_return_if_fail (display == _gdk_display);
-
+
if (width)
*width = GetSystemMetrics (SM_CXCURSOR);
if (height)
GdkCursorClass *cursor_class = GDK_CURSOR_CLASS (klass);
object_class->finalize = _gdk_win32_cursor_finalize;
-
+
cursor_class->get_surface = _gdk_win32_cursor_get_surface;
}
return;
virtual->active_device = new_active;
-
+
if (gdk_device_get_source (device) != GDK_SOURCE_KEYBOARD)
{
_gdk_device_reset_axes (device);
for (i = 0; i < n_axes; i++)
{
_gdk_device_get_axis_info (new_active, i,
- &label_atom, &use,
+ &label_atom, &use,
&min_value, &max_value, &resolution);
_gdk_device_add_axis (device,
- label_atom, use,
+ label_atom, use,
min_value, max_value, resolution);
}
}
if (win_y)
*win_y += _gdk_offset_y;
-
+
if (root_x)
*root_x += _gdk_offset_x;
}
static GdkDevice *
-create_pointer (GdkDeviceManager *device_manager,
+create_pointer (GdkDeviceManager *device_manager,
GType g_type,
const char *name,
GdkDeviceType type)
}
static GdkDevice *
-create_keyboard (GdkDeviceManager *device_manager,
+create_keyboard (GdkDeviceManager *device_manager,
GType g_type,
const char *name,
GdkDeviceType type)
wintab32_dll_path = g_malloc (n + 1 + strlen (WINTAB32_DLL));
k = GetSystemDirectory (wintab32_dll_path, n);
-
+
if (k == 0 || k > n)
{
g_free (wintab32_dll_path);
GdkDeviceManagerWin32 *device_manager;
device_manager = GDK_DEVICE_MANAGER_WIN32 (object);
- device_manager->core_pointer =
+ device_manager->core_pointer =
create_pointer (GDK_DEVICE_MANAGER (device_manager),
GDK_TYPE_DEVICE_VIRTUAL,
"Virtual Core Pointer",
GDK_DEVICE_TYPE_MASTER);
- device_manager->system_pointer =
+ device_manager->system_pointer =
create_pointer (GDK_DEVICE_MANAGER (device_manager),
GDK_TYPE_DEVICE_WIN32,
"System Aggregated Pointer",
_gdk_device_set_associated_device (device_manager->system_pointer, device_manager->core_pointer);
_gdk_device_add_slave (device_manager->core_pointer, device_manager->system_pointer);
- device_manager->core_keyboard =
+ device_manager->core_keyboard =
create_keyboard (GDK_DEVICE_MANAGER (device_manager),
GDK_TYPE_DEVICE_VIRTUAL,
"Virtual Core Keyboard",
GDK_DEVICE_TYPE_MASTER);
- device_manager->system_keyboard =
+ device_manager->system_keyboard =
create_keyboard (GDK_DEVICE_MANAGER (device_manager),
GDK_TYPE_DEVICE_WIN32,
"System Aggregated Keyboard",
devices = g_list_prepend (devices, device_manager_win32->core_keyboard);
devices = g_list_prepend (devices, device_manager_win32->core_pointer);
}
- else
+ else
{
if (type == GDK_DEVICE_TYPE_SLAVE)
{
return NULL;
}
-static gboolean
+static gboolean
gdk_win32_display_request_selection_notification (GdkDisplay *display,
GdkAtom selection)
{
}
-static gboolean
+static gboolean
gdk_win32_display_supports_shapes (GdkDisplay *display)
{
g_return_val_if_fail (GDK_IS_DISPLAY (display), FALSE);
display_class->text_property_to_utf8_list = _gdk_win32_display_text_property_to_utf8_list;
display_class->utf8_to_string_target = _gdk_win32_display_utf8_to_string_target;
display_class->make_gl_context_current = _gdk_win32_display_make_gl_context_current;
-
+
_gdk_win32_windowing_init ();
}
* the current Windows code page. See gdkim-win32.c for more info on that.
*
*/
-
+
/* The mingw.org compiler does not export GUIDS in it's import library. To work
* around that, define INITGUID to have the GUIDS declared. */
#if defined(__MINGW32__) && !defined(__MINGW64_VERSION_MAJOR)
* Modified by the GTK+ Team and others 1997-2000. See the AUTHORS
* file for a list of people on the GTK+ Team. See the ChangeLog
* files for a list of changes. These files are distributed with
- * GTK+ at ftp://ftp.gtk.org/pub/gtk/.
+ * GTK+ at ftp://ftp.gtk.org/pub/gtk/.
*/
/* Cannot use TrackMouseEvent, as the stupid WM_MOUSELEAVE message
* GDK_LEAVE_NOTIFY events, which would help get rid of those pesky
* tooltips sometimes popping up in the wrong place.
*
- * Update: a combination of TrackMouseEvent, GetCursorPos and
+ * Update: a combination of TrackMouseEvent, GetCursorPos and
* GetWindowPos can and is actually used to get rid of those
* pesky tooltips. It should be possible to use this for the
* whole ENTER/LEAVE NOTIFY handling but some platforms may
#define SWP_NOCLIENTSIZE 0x0800
#define SWP_NOCLIENTMOVE 0x1000
#define SWP_STATECHANGED 0x8000
-/*
+/*
* Private function declarations
*/
_gdk_win32_append_event (event);
}
-static LRESULT
+static LRESULT
inner_window_procedure (HWND hwnd,
UINT message,
WPARAM wparam,
GDK_NOTE (EVENTS, g_print ("%s%*s%s %p",
(debug_indent > 0 ? "\n" : ""),
- debug_indent, "",
+ debug_indent, "",
_gdk_win32_message_to_string (message), hwnd));
debug_indent += 2;
retval = inner_window_procedure (hwnd, message, wparam, lparam);
return retval;
}
-void
+void
_gdk_events_init (void)
{
GSource *source;
#endif
source = g_source_new (&event_funcs, sizeof (GSource));
- g_source_set_name (source, "GDK Win32 event source");
+ g_source_set_name (source, "GDK Win32 event source");
g_source_set_priority (source, GDK_PRIORITY_EVENTS);
#ifdef G_WITH_CYGWIN
event_poll_fd.fd = G_WIN32_MSG_HANDLE;
#endif
event_poll_fd.events = G_IO_IN;
-
+
g_source_add_poll (source, &event_poll_fd);
g_source_set_can_recurse (source, TRUE);
g_source_attach (source, NULL);
build_pointer_event_state (MSG *msg)
{
gint state;
-
+
state = 0;
if (msg->wParam & MK_CONTROL)
BYTE *key_state)
{
event->key.time = _gdk_win32_get_next_tick (msg->time);
-
+
build_key_event_state (event, key_state);
event->key.hardware_keycode = 0; /* FIXME: What should it be? */
event->button.x_root, event->button.y_root);
print_event_state (event->button.state);
break;
- case GDK_KEY_PRESS:
+ case GDK_KEY_PRESS:
case GDK_KEY_RELEASE:
if (event->key.length == 0)
escaped = g_strdup ("");
default:
/* Nothing */
break;
- }
- g_print ("%s", (debug_indent == 0 ? "\n" : ""));
+ }
+ g_print ("%s", (debug_indent == 0 ? "\n" : ""));
}
static char *
if ((event->any.type == GDK_OWNER_CHANGE) &&
(event->owner_change.owner != NULL))
g_object_ref (event->owner_change.owner);
- event->any.send_event = InSendMessage ();
+ event->any.send_event = InSendMessage ();
}
void
_gdk_win32_append_event (GdkEvent *event)
{
GList *link;
-
+
fixup_event (event);
#if 1
link = _gdk_event_queue_append (_gdk_display, event);
/* Fill in event->string crudely, since various programs
* depend on it.
*/
-
+
c = 0;
if (event->key.keyval != GDK_KEY_VoidSymbol)
c = gdk_keyval_to_unicode (event->key.keyval);
{
gsize bytes_written;
gint len;
-
+
/* Apply the control key - Taken from Xlib
*/
if (event->key.state & GDK_CONTROL_MASK)
else if (c == '/')
c = '_' & 0x1F;
}
-
+
len = g_unichar_to_utf8 (c, buf);
buf[len] = '\0';
-
+
event->key.string = g_locale_from_utf8 (buf, len,
NULL, &bytes_written,
NULL);
event->key.length = 1;
event->key.string = g_strdup ("\r");
}
-
+
if (!event->key.string)
{
event->key.length = 0;
* more events and append them after it if it likes.
*/
node = _gdk_event_queue_append (_gdk_display, event);
-
+
tmp_list = *filters;
while (tmp_list)
{
pt = *screen_pt;
ScreenToClient (GDK_WINDOW_HWND (window), &pt);
-
+
event = gdk_event_new (type);
event->crossing.window = window;
event->crossing.subwindow = subwindow;
window->width = client_rect.right - client_rect.left;
window->height = client_rect.bottom - client_rect.top;
-
+
window->x = point.x;
window->y = point.y;
_gdk_window_update_size (window);
-
+
if (window->event_mask & GDK_STRUCTURE_MASK)
{
GdkEvent *event = gdk_event_new (GDK_CONFIGURE);
event->configure.width = client_rect.right - client_rect.left;
event->configure.height = client_rect.bottom - client_rect.top;
-
+
event->configure.x = point.x;
event->configure.y = point.y;
DeleteObject (hrgn);
}
-static VOID CALLBACK
+static VOID CALLBACK
modal_timer_proc (HWND hwnd,
UINT msg,
UINT_PTR id,
/* Apply global filters */
GdkFilterReturn result = apply_event_filters (NULL, msg, &_gdk_default_filters);
-
+
/* If result is GDK_FILTER_CONTINUE, we continue as if nothing
* happened. If it is GDK_FILTER_REMOVE or GDK_FILTER_TRANSLATE,
* we return TRUE, and DefWindowProcW() will not be called.
* #define return to a syntax error...
*/
#define return GOTO_DONE_INSTEAD
-
+
if (!GDK_WINDOW_DESTROYED (window) && window->filters)
{
/* Apply per-window filters */
case WM_KEYUP:
case WM_KEYDOWN:
- GDK_NOTE (EVENTS,
+ GDK_NOTE (EVENTS,
g_print (" %s ch:%.02x %s",
_gdk_win32_key_to_string (msg->lParam),
(int) msg->wParam,
API_CALL (GetKeyboardState, (key_state));
/* g_print ("ctrl:%02x lctrl:%02x rctrl:%02x alt:%02x lalt:%02x ralt:%02x\n", key_state[VK_CONTROL], key_state[VK_LCONTROL], key_state[VK_RCONTROL], key_state[VK_MENU], key_state[VK_LMENU], key_state[VK_RMENU]); */
-
+
build_key_event_state (event, key_state);
if (msg->wParam == VK_PACKET &&
_gdk_win32_append_event (event);
}
-
+
if (window->event_mask & GDK_KEY_RELEASE_MASK)
{
/* Build a key release event. */
button = 5;
buttondown0:
- GDK_NOTE (EVENTS,
+ GDK_NOTE (EVENTS,
g_print (" (%d,%d)",
GET_X_LPARAM (msg->lParam), GET_Y_LPARAM (msg->lParam)));
button = 5;
buttonup0:
- GDK_NOTE (EVENTS,
+ GDK_NOTE (EVENTS,
g_print (" (%d,%d)",
GET_X_LPARAM (msg->lParam), GET_Y_LPARAM (msg->lParam)));
if (mouse_window != new_window)
{
GDK_NOTE (EVENTS, g_print (" mouse_sinwod %p -> %p",
- mouse_window ? GDK_WINDOW_HWND (mouse_window) : NULL,
+ mouse_window ? GDK_WINDOW_HWND (mouse_window) : NULL,
new_window ? GDK_WINDOW_HWND (new_window) : NULL));
synthesize_crossing_events (_gdk_display,
mouse_window, new_window,
if (new_window != NULL)
track_mouse_event (TME_LEAVE, GDK_WINDOW_HWND (new_window));
}
- else if (new_window != NULL &&
+ else if (new_window != NULL &&
new_window == mouse_window_ignored_leave)
{
/* If we ignored a leave event for this window and we're now getting
/* The synapitics trackpad drivers have this irritating
feature where it pops up a window right under the pointer
- when you scroll. We ignore the leave and enter events for
+ when you scroll. We ignore the leave and enter events for
this window */
if (GetClassNameA (hwnd, classname, sizeof(classname)) &&
strcmp (classname, SYNAPSIS_ICON_WINDOW_CLASS) == 0)
if ((hwnd = WindowFromPoint (point)) == NULL)
break;
-
+
{
char classname[64];
gdk_event_set_source_device (event, device_manager_win32->system_pointer);
_gdk_win32_append_event (event);
-
+
return_val = TRUE;
break;
case WM_MOUSEACTIVATE:
{
- if (gdk_window_get_window_type (window) == GDK_WINDOW_TEMP
+ if (gdk_window_get_window_type (window) == GDK_WINDOW_TEMP
|| !window->accept_focus)
{
*ret_valp = MA_NOACTIVATE;
case WM_ERASEBKGND:
GDK_NOTE (EVENTS, g_print (" %p", (HANDLE) msg->wParam));
-
+
if (GDK_WINDOW_DESTROYED (window))
break;
windowpos->cx, windowpos->cy, windowpos->x, windowpos->y));
/* Break grabs on unmap or minimize */
- if (windowpos->flags & SWP_HIDEWINDOW ||
+ if (windowpos->flags & SWP_HIDEWINDOW ||
((windowpos->flags & SWP_STATECHANGED) && IsIconic (msg->hwnd)))
{
GdkDevice *device = gdk_device_manager_get_client_pointer (device_manager);
/* Whenever one window changes iconified state we need to also
* change the iconified state in all transient related windows,
- * as windows doesn't give icons for transient childrens.
+ * as windows doesn't give icons for transient childrens.
*/
- if ((old_state & GDK_WINDOW_STATE_ICONIFIED) !=
+ if ((old_state & GDK_WINDOW_STATE_ICONIFIED) !=
(new_state & GDK_WINDOW_STATE_ICONIFIED))
do_show_window (window, (new_state & GDK_WINDOW_STATE_ICONIFIED));
- /* When un-minimizing, make sure we're stacked under any
+ /* When un-minimizing, make sure we're stacked under any
transient-type windows. */
if (!(old_state & GDK_WINDOW_STATE_ICONIFIED) &&
(new_state & GDK_WINDOW_STATE_ICONIFIED))
(msg->wParam == WMSZ_TOP ? "TOP" :
(msg->wParam == WMSZ_TOPRIGHT ? "TOPRIGHT" :
(msg->wParam == WMSZ_RIGHT ? "RIGHT" :
-
+
(msg->wParam == WMSZ_BOTTOMRIGHT ? "BOTTOMRIGHT" :
"???")))))))),
_gdk_win32_rect_to_string (&rect),
ClientToScreen (GDK_WINDOW_HWND (window), &point);
rect.right = point.x;
rect.bottom = point.y;
-
+
GDK_NOTE (EVENTS, g_print (" (also BASE_SIZE, using %s)",
_gdk_win32_rect_to_string (&rect)));
}
case WM_DISPLAYCHANGE:
handle_display_change ();
break;
-
+
case WM_DWMCOMPOSITIONCHANGED:
_gdk_win32_window_enable_transparency (window);
break;
-
+
case WM_DESTROYCLIPBOARD:
if (!_ignore_destroy_clipboard)
{
GDK_NOTE (EVENTS, g_print (" %d %p",
(int) msg->wParam, (gpointer) msg->lParam));
goto wintab;
-
+
case WT_CSRCHANGE:
GDK_NOTE (EVENTS, g_print (" %d %p",
(int) msg->wParam, (gpointer) msg->lParam));
goto wintab;
-
+
case WT_PROXIMITY:
GDK_NOTE (EVENTS, g_print (" %p %d %d",
(gpointer) msg->wParam,
if (window)
g_object_unref (window);
-
+
#undef return
return return_val;
}
if (modal_win32_dialog != NULL)
return;
-
+
while (!_gdk_event_queue_find_first (display) &&
PeekMessageW (&msg, NULL, 0, 0, PM_REMOVE))
{
gdk_event_check (GSource *source)
{
gboolean retval;
-
+
gdk_threads_enter ();
if (_gdk_display->event_pause_count > 0)
gpointer user_data)
{
GdkEvent *event;
-
+
gdk_threads_enter ();
_gdk_win32_display_queue_events (_gdk_display);
if (event)
{
_gdk_event_emit (event);
-
+
gdk_event_free (event);
/* Do drag & drop if it is still pending */
- if (_dnd_source_state == GDK_WIN32_DND_PENDING)
+ if (_dnd_source_state == GDK_WIN32_DND_PENDING)
{
_dnd_source_state = GDK_WIN32_DND_DRAGGING;
_gdk_win32_dnd_do_dragdrop ();
_dnd_source_state = GDK_WIN32_DND_NONE;
}
}
-
+
gdk_threads_leave ();
return TRUE;
* win32_x/win32_y < -16383) after scrolling. They needed to be moved
* back to the real position determined by gdk_window_compute_position().
* This is handled in gdk_window_postmove().
- *
+ *
* The X11 version by Owen Taylor <otaylor@redhat.com>
* Copyright Red Hat, Inc. 2000
* Win32 hack by Tor Lillqvist <tml@iki.fi>
_gdk_win32_window_tmp_unset_parent_bg (window);
_gdk_win32_window_tmp_unset_bg (window, TRUE);
-
+
GDK_NOTE (MISC, g_print ("... SetWindowPos(%p,NULL,%d,%d,%d,%d,"
"NOACTIVATE|NOZORDER)\n",
GDK_WINDOW_HWND (window),
- window->x + window->parent->abs_x, window->y + window->parent->abs_y,
+ window->x + window->parent->abs_x, window->y + window->parent->abs_y,
width, height));
API_CALL (SetWindowPos, (GDK_WINDOW_HWND (window), NULL,
- window->x + window->parent->abs_x, window->y + window->parent->abs_y,
+ window->x + window->parent->abs_x, window->y + window->parent->abs_y,
width, height,
SWP_NOACTIVATE | SWP_NOZORDER));
* Modified by the GTK+ Team and others 1997-2000. See the AUTHORS
* file for a list of people on the GTK+ Team. See the ChangeLog
* files for a list of changes. These files are distributed with
- * GTK+ at ftp://ftp.gtk.org/pub/gtk/.
+ * GTK+ at ftp://ftp.gtk.org/pub/gtk/.
*/
#include "config.h"
* Modified by the GTK+ Team and others 1997-2000. See the AUTHORS
* file for a list of people on the GTK+ Team. See the ChangeLog
* files for a list of changes. These files are distributed with
- * GTK+ at ftp://ftp.gtk.org/pub/gtk/.
+ * GTK+ at ftp://ftp.gtk.org/pub/gtk/.
*/
/* This file should really be one level up, in the backend-independent
* GDK, and the x11/gdkinput.c could also be removed.
- *
+ *
* That stuff in x11/gdkinput.c which really *is* X11-dependent should
* be in x11/gdkinput-x11.c.
*/
print_keysym_tab (void)
{
gint vk;
-
+
g_print ("keymap:%s%s\n",
_gdk_keyboard_has_altgr ? " (uses AltGr)" : "",
(gdk_shift_modifiers & GDK_LOCK_MASK) ? " (has ShiftLock)" : "");
for (vk = 0; vk < KEY_STATE_SIZE; vk++)
{
gint state;
-
+
g_print ("%#.02x: ", vk);
for (state = 0; state < 4; state++)
{
for (shift = 0; shift < 4; shift++)
{
guint *ksymp = keysym_tab + vk*4 + shift;
-
+
set_shift_vks (key_state, shift);
*ksymp = 0;
(keysym_tab[vk*4 + 3] != GDK_KEY_VoidSymbol &&
keysym_tab[vk*4 + 1] != keysym_tab[vk*4 + 3]))
_gdk_keyboard_has_altgr = TRUE;
-
+
if (!capslock_tested)
{
/* Can we use this virtual key to determine the CapsLock
keysym_tab[vk*4 + 1] != gdk_keyval_to_upper (keysym_tab[vk*4 + 0]))
{
guchar chars[2];
-
+
capslock_tested = TRUE;
-
+
key_state[VK_SHIFT] = 0;
key_state[VK_CONTROL] = key_state[VK_MENU] = 0;
key_state[VK_CAPITAL] = 1;
}
}
key_state[VK_CAPITAL] = 0;
- }
+ }
}
}
}
GDK_NOTE (EVENTS, print_keysym_tab ());
-}
+}
GdkKeymap*
_gdk_win32_display_get_keymap (GdkDisplay *display)
g_return_val_if_fail (keys != NULL, FALSE);
g_return_val_if_fail (n_keys != NULL, FALSE);
g_return_val_if_fail (keyval != 0, FALSE);
-
+
retval = g_array_new (FALSE, FALSE, sizeof (GdkKeymapKey));
/* Accept only the default keymap */
if (keymap == NULL || keymap == gdk_keymap_get_default ())
{
gint vk;
-
+
update_keymap ();
for (vk = 0; vk < KEY_STATE_SIZE; vk++)
if (keysym_tab[vk*4+i] == keyval)
{
GdkKeymapKey key;
-
+
key.keycode = vk;
-
+
/* 2 levels (normal, shift), two groups (normal, AltGr) */
key.group = i / 2;
key.level = i % 2;
-
+
g_array_append_val (retval, key);
}
}
*keys = NULL;
*n_keys = 0;
}
-
+
g_array_free (retval, retval->len > 0 ? FALSE : TRUE);
return *n_keys > 0;
*n_entries = 0;
return FALSE;
}
-
+
if (keys)
key_array = g_array_new (FALSE, FALSE, sizeof (GdkKeymapKey));
else
key_array = NULL;
-
+
if (keyvals)
keyval_array = g_array_new (FALSE, FALSE, sizeof (guint));
else
keyval_array = NULL;
-
+
/* Accept only the default keymap */
if (keymap == NULL || keymap == gdk_keymap_get_default ())
{
if (key_array)
{
GdkKeymapKey key;
-
+
key.keycode = hardware_keycode;
-
+
key.group = i / 2;
key.level = i % 2;
-
+
g_array_append_val (key_array, key);
}
if (keyvals)
*keyvals = NULL;
-
+
*n_entries = 0;
}
g_return_val_if_fail (keymap == NULL || GDK_IS_KEYMAP (keymap), 0);
g_return_val_if_fail (key != NULL, 0);
g_return_val_if_fail (key->group < 4, 0);
-
+
/* Accept only the default keymap */
if (keymap != NULL && keymap != gdk_keymap_get_default ())
return 0;
update_keymap ();
-
+
if (key->keycode >= KEY_STATE_SIZE ||
key->group < 0 || key->group >= 2 ||
key->level < 0 || key->level >= 2)
return 0;
-
+
sym = keysym_tab[key->keycode*4 + key->group*2 + key->level];
-
+
if (sym == GDK_KEY_VoidSymbol)
return 0;
else
gint shift_level;
gboolean ignore_shift = FALSE;
gboolean ignore_group = FALSE;
-
+
g_return_val_if_fail (keymap == NULL || GDK_IS_KEYMAP (keymap), FALSE);
g_return_val_if_fail (group < 4, FALSE);
-
+
#if 0
GDK_NOTE (EVENTS, g_print ("gdk_keymap_translate_keyboard_state: keycode=%#x state=%#x group=%d\n",
hardware_keycode, state, group));
(ignore_group ? 0 : GDK_MOD2_MASK) |
(ignore_shift ? 0 : (GDK_SHIFT_MASK|GDK_LOCK_MASK));
}
-
+
#if 0
GDK_NOTE (EVENTS, g_print ("... group=%d level=%d cmods=%#x keyval=%s\n",
group, shift_level, tmp_modifiers, gdk_keyval_name (tmp_keyval)));
* Modified by the GTK+ Team and others 1997-2000. See the AUTHORS
* file for a list of people on the GTK+ Team. See the ChangeLog
* files for a list of changes. These files are distributed with
- * GTK+ at ftp://ftp.gtk.org/pub/gtk/.
+ * GTK+ at ftp://ftp.gtk.org/pub/gtk/.
*/
#include "config.h"
static gboolean dummy;
const GOptionEntry _gdk_windowing_args[] = {
- { "sync", 0, 0, G_OPTION_ARG_NONE, &gdk_synchronize,
+ { "sync", 0, 0, G_OPTION_ARG_NONE, &gdk_synchronize,
/* Description of --sync in --help output */ N_("Don't batch GDI requests"), NULL },
- { "no-wintab", 0, 0, G_OPTION_ARG_NONE, &_gdk_input_ignore_wintab,
+ { "no-wintab", 0, 0, G_OPTION_ARG_NONE, &_gdk_input_ignore_wintab,
/* Description of --no-wintab in --help output */ N_("Don't use the Wintab API for tablet support"), NULL },
- { "ignore-wintab", 0, 0, G_OPTION_ARG_NONE, &_gdk_input_ignore_wintab,
+ { "ignore-wintab", 0, 0, G_OPTION_ARG_NONE, &_gdk_input_ignore_wintab,
/* Description of --ignore-wintab in --help output */ N_("Same as --no-wintab"), NULL },
{ "use-wintab", 0, 0, G_OPTION_ARG_NONE, &dummy,
/* Description of --use-wintab in --help output */ N_("Do use the Wintab API [default]"), NULL },
- { "max-colors", 0, 0, G_OPTION_ARG_INT, &_gdk_max_colors,
- /* Description of --max-colors=COLORS in --help output */ N_("Size of the palette in 8 bit mode"),
+ { "max-colors", 0, 0, G_OPTION_ARG_INT, &_gdk_max_colors,
+ /* Description of --max-colors=COLORS in --help output */ N_("Size of the palette in 8 bit mode"),
/* Placeholder in --max-colors=COLORS in --help output */ N_("COLORS") },
{ NULL }
};
default: return static_printf ("illegal_%d", protocol);
}
/* NOTREACHED */
- return NULL;
+ return NULL;
}
gchar *
BIT (STICKY);
#undef BIT
- return static_printf ("%s", buf);
+ return static_printf ("%s", buf);
}
gchar *
BIT (VSCROLL);
#undef BIT
- return static_printf ("%s", buf);
+ return static_printf ("%s", buf);
}
gchar *
BIT (WINDOWEDGE);
#undef BIT
- return static_printf ("%s", buf);
+ return static_printf ("%s", buf);
}
gchar *
BIT (ASYNCWINDOWPOS);
#undef BIT
- return static_printf ("%s", buf);
+ return static_printf ("%s", buf);
}
gchar *
BIT (ASK);
#undef BIT
- return static_printf ("%s", buf);
+ return static_printf ("%s", buf);
}
gchar *
return static_printf ("unk-%#lx", lParam);
}
-
+
gchar *
_gdk_win32_cf_to_string (UINT format)
{
return static_printf ("unk-%#lx", format);
}
}
-
+
gchar *
_gdk_win32_data_to_string (const guchar *data,
int nbytes)
* Modified by the GTK+ Team and others 1997-2000. See the AUTHORS
* file for a list of people on the GTK+ Team. See the ChangeLog
* files for a list of changes. These files are distributed with
- * GTK+ at ftp://ftp.gtk.org/pub/gtk/.
+ * GTK+ at ftp://ftp.gtk.org/pub/gtk/.
*/
#ifndef __GDK_PRIVATE_WIN32_H__
#define WIN32_API_FAILED(api) _gdk_win32_api_failed (G_STRLOC , api)
#define WIN32_GDI_FAILED(api) WIN32_API_FAILED (api)
#define OTHER_API_FAILED(api) _gdk_other_api_failed (G_STRLOC, api)
-
+
/* These two macros call a GDI or other Win32 API and if the return
* value is zero or NULL, print a warning message. The majority of GDI
* calls return zero or NULL on failure. The value of the macros is nonzero
#define GDI_CALL(api, arglist) (api arglist ? 1 : (WIN32_GDI_FAILED (#api), 0))
#define API_CALL(api, arglist) (api arglist ? 1 : (WIN32_API_FAILED (#api), 0))
-
+
extern LRESULT CALLBACK _gdk_win32_window_procedure (HWND, UINT, WPARAM, LPARAM);
extern GdkWindow *_gdk_root;
GdkAtom _gdk_win32_display_manager_atom_intern (GdkDisplayManager *manager,
const gchar *atom_name,
gint only_if_exists);
-gchar *_gdk_win32_display_manager_get_atom_name (GdkDisplayManager *manager,
+gchar *_gdk_win32_display_manager_get_atom_name (GdkDisplayManager *manager,
GdkAtom atom);
void _gdk_win32_append_event (GdkEvent *event);
void _gdk_win32_emit_configure_event (GdkWindow *window);
* Modified by the GTK+ Team and others 1997-2000. See the AUTHORS
* file for a list of people on the GTK+ Team. See the ChangeLog
* files for a list of changes. These files are distributed with
- * GTK+ at ftp://ftp.gtk.org/pub/gtk/.
+ * GTK+ at ftp://ftp.gtk.org/pub/gtk/.
*/
#include "config.h"
ATOM win32_atom;
GdkAtom retval;
static GHashTable *atom_hash = NULL;
-
+
if (!atom_hash)
atom_hash = g_hash_table_new (g_str_hash, g_str_equal);
win32_atom = GlobalAddAtom (atom_name);
retval = GUINT_TO_POINTER ((guint) win32_atom);
}
- g_hash_table_insert (atom_hash,
- g_strdup (atom_name),
+ g_hash_table_insert (atom_hash,
+ g_strdup (atom_name),
retval);
}
}
gchar *
-_gdk_win32_display_manager_get_atom_name (GdkDisplayManager *manager,
+_gdk_win32_display_manager_get_atom_name (GdkDisplayManager *manager,
GdkAtom atom)
{
ATOM win32_atom;
else if (GDK_SELECTION_TYPE_PIXMAP == atom) return g_strdup ("PIXMAP");
else if (GDK_SELECTION_TYPE_WINDOW == atom) return g_strdup ("WINDOW");
else if (GDK_SELECTION_TYPE_STRING == atom) return g_strdup ("STRING");
-
+
win32_atom = GPOINTER_TO_UINT (atom);
-
+
if (win32_atom < 0xC000)
return g_strdup_printf ("#%p", atom);
else if (GlobalGetAtomName (win32_atom, name, sizeof (name)) == 0)
GDK_NOTE (DND, {
gchar *prop_name = gdk_atom_name (property);
gchar *type_name = gdk_atom_name (type);
-
+
g_print ("gdk_property_change: %p %s %s %s %d*%d bits: %s\n",
GDK_WINDOW_HWND (window),
prop_name,
for (i = 0; i < wclen; i++)
if (wcptr[i] == '\n' && (i == 0 || wcptr[i - 1] != '\r'))
size += 2;
-
+
if (!(hdata = GlobalAlloc (GMEM_MOVEABLE, size)))
{
WIN32_API_FAILED ("GlobalAlloc");
hdata));
if (!SetClipboardData (CF_UNICODETEXT, hdata))
WIN32_API_FAILED ("SetClipboardData");
-
+
if (!CloseClipboard ())
WIN32_API_FAILED ("CloseClipboard");
}
*/
int nHeight = (0 > ncm.lfMenuFont.lfHeight ? - 3 * ncm.lfMenuFont.lfHeight / 4 : 10);
if (OUT_STRING_PRECIS == ncm.lfMenuFont.lfOutPrecision)
- GDK_NOTE(MISC, g_print("gdk_screen_get_setting(%s) : ignoring bitmap font '%s'\n",
+ GDK_NOTE(MISC, g_print("gdk_screen_get_setting(%s) : ignoring bitmap font '%s'\n",
name, ncm.lfMenuFont.lfFaceName));
else if (ncm.lfMenuFont.lfFaceName && strlen(ncm.lfMenuFont.lfFaceName) > 0 &&
/* Avoid issues like those described in bug #135098 */
* Modified by the GTK+ Team and others 1997-2000. See the AUTHORS
* file for a list of people on the GTK+ Team. See the ChangeLog
* files for a list of changes. These files are distributed with
- * GTK+ at ftp://ftp.gtk.org/pub/gtk/.
+ * GTK+ at ftp://ftp.gtk.org/pub/gtk/.
*/
#include "config.h"
}
g_slist_free (pixbuf_formats);
-
+
text_plain = gdk_atom_intern ("text/plain", FALSE);
text_plain_charset_utf_8= gdk_atom_intern ("text/plain;charset=utf-8", FALSE);
text_plain_charset_CP1252 = gdk_atom_intern ("text/plain;charset=CP1252", FALSE);
* This routine strips out all non-allowed C0 and C1 characters
* from the input string and also canonicalizes \r, and \r\n to \n
*/
-static gchar *
+static gchar *
sanitize_utf8 (const gchar *src,
gint length)
{
gunichar ch = g_utf8_get_char (p);
char buf[7];
gint buflen;
-
+
if (!((ch < 0x20 && ch != '\t' && ch != '\n') || (ch >= 0x7f && ch < 0xa0)))
{
buflen = g_unichar_to_utf8 (ch, buf);
gint length)
{
GError *error = NULL;
-
+
gchar *tmp_str = sanitize_utf8 (str, length);
gchar *result = g_convert_with_fallback (tmp_str, -1,
"ISO-8859-1", "UTF-8",
error->message);
g_error_free (error);
}
-
+
g_free (tmp_str);
return result;
}
if (gdk_target == _image_jpeg)
return g_strdup ("JFIF");
-
+
if (gdk_target == _image_gif)
return g_strdup ("GIF");
-
+
return gdk_atom_name (gdk_target);
}
GDK_NOTE (DND, {
gchar *sel_name = gdk_atom_name (selection);
-
+
g_print ("gdk_selection_owner_get: %s = %p\n",
sel_name,
(window ? GDK_WINDOW_HWND (window) : NULL));
GDK_NOTE (DND, {
gchar *sel_name = gdk_atom_name (selection);
gchar *tgt_name = gdk_atom_name (target);
-
+
g_print ("gdk_selection_convert: %p %s %s\n",
GDK_WINDOW_HWND (requestor),
sel_name, tgt_name);
GDK_NOTE (DND, {
int i;
-
+
g_print ("... ");
for (i = 0; i < ntargets; i++)
{
{
new_length = data_length + sizeof (BITMAPFILEHEADER);
}
-
+
data = g_try_malloc (new_length);
if (data)
if (p[3] != 0)
{
gdouble inverse_alpha = 255./p[3];
-
+
p[0] = p[0] * inverse_alpha + 0.5;
p[1] = p[1] * inverse_alpha + 0.5;
p[2] = p[2] * inverse_alpha + 0.5;
{
char sFormat[80];
- if (GetClipboardFormatName (fmt, sFormat, 80) > 0 &&
+ if (GetClipboardFormatName (fmt, sFormat, 80) > 0 &&
strcmp (sFormat, mapped_target_name) == 0)
{
if ((hdata = GetClipboardData (fmt)) != NULL)
if ((ptr = GlobalLock (hdata)) != NULL)
{
length = GlobalSize (hdata);
-
+
GDK_NOTE (DND, g_print ("... %s: %d bytes\n", mapped_target_name, length));
-
+
selection_property_store (requestor, target, 8,
g_memdup (ptr, length), length);
GlobalUnlock (hdata);
if (GDK_WINDOW_DESTROYED (requestor))
return 0;
-
+
GDK_NOTE (DND, g_print ("gdk_selection_property_get: %p",
GDK_WINDOW_HWND (requestor)));
gchar *sel_name = gdk_atom_name (selection);
gchar *tgt_name = gdk_atom_name (target);
gchar *prop_name = gdk_atom_name (property);
-
+
g_print ("gdk_selection_send_notify_for_display: %p %s %s %s (no-op)\n",
requestor, sel_name, tgt_name, prop_name);
g_free (sel_name);
gint
gdk_text_property_to_text_list_for_display (GdkDisplay *display,
GdkAtom encoding,
- gint format,
+ gint format,
const guchar *text,
gint length,
gchar ***list)
GDK_NOTE (DND, {
gchar *enc_name = gdk_atom_name (encoding);
-
+
g_print ("gdk_text_property_to_text_list_for_display: %s %d %.20s %d\n",
enc_name, format, text, length);
g_free (enc_name);
});
-
+
if (!list)
return 0;
source_charset = g_strdup ("UTF-8");
else
source_charset = gdk_atom_name (encoding);
-
+
g_get_charset (&charset);
result = g_convert ((const gchar *) text, length, charset, source_charset,
*list = g_new (gchar *, 1);
**list = result;
-
+
return 1;
}
while (p < text + length)
{
gchar *str;
-
+
q = p;
while (*q && q < text + length)
q++;
*list = g_new (gchar *, n_strings + 1);
(*list)[n_strings] = NULL;
-
+
i = n_strings;
tmp_list = strings;
while (tmp_list)
if (format)
*format = 0;
-
+
if (ctext)
*ctext = NULL;
GDK_NOTE (DND, {
gchar *sel_name = gdk_atom_name (selection);
-
+
g_print ("gdk_win32_selection_add_targets: %p: %s: ",
owner ? GDK_WINDOW_HWND (owner) : NULL,
sel_name);
UINT cf;
gchar *target_name;
int j;
-
+
for (j = 0; j < n_known_pixbuf_formats; j++)
if (targets[i] == known_pixbuf_formats[j])
{
}
break;
}
-
+
/* If it is one of the pixmap formats, already handled or not
* needed.
*/
g_hash_table_replace (_format_atom_table,
GINT_TO_POINTER (cf),
targets[i]);
-
+
GDK_NOTE (DND, g_print ("... SetClipboardData(%s,NULL)\n",
_gdk_win32_cf_to_string (cf)));
SetClipboardData (cf, NULL);
* Modified by the GTK+ Team and others 1997-2000. See the AUTHORS
* file for a list of people on the GTK+ Team. See the ChangeLog
* files for a list of changes. These files are distributed with
- * GTK+ at ftp://ftp.gtk.org/pub/gtk/.
+ * GTK+ at ftp://ftp.gtk.org/pub/gtk/.
*/
#include "config.h"
if (max_colors != NULL)
_gdk_max_colors = atoi (max_colors);
-
+
map_entries = _gdk_max_colors;
if (map_entries >= 16 && map_entries < sizepalette)
* Modified by the GTK+ Team and others 1997-2000. See the AUTHORS
* file for a list of people on the GTK+ Team. See the ChangeLog
* files for a list of changes. These files are distributed with
- * GTK+ at ftp://ftp.gtk.org/pub/gtk/.
+ * GTK+ at ftp://ftp.gtk.org/pub/gtk/.
*/
#ifndef __GDK_WIN32_H__
* Modified by the GTK+ Team and others 1997-2000. See the AUTHORS
* file for a list of people on the GTK+ Team. See the ChangeLog
* files for a list of changes. These files are distributed with
- * GTK+ at ftp://ftp.gtk.org/pub/gtk/.
+ * GTK+ at ftp://ftp.gtk.org/pub/gtk/.
*/
#ifndef __GDK_WIN32_CURSOR_H__
* Modified by the GTK+ Team and others 1997-2000. See the AUTHORS
* file for a list of people on the GTK+ Team. See the ChangeLog
* files for a list of changes. These files are distributed with
- * GTK+ at ftp://ftp.gtk.org/pub/gtk/.
+ * GTK+ at ftp://ftp.gtk.org/pub/gtk/.
*/
#ifndef __GDK_WIN32_DISPLAY_H__
* Modified by the GTK+ Team and others 1997-2000. See the AUTHORS
* file for a list of people on the GTK+ Team. See the ChangeLog
* files for a list of changes. These files are distributed with
- * GTK+ at ftp://ftp.gtk.org/pub/gtk/.
+ * GTK+ at ftp://ftp.gtk.org/pub/gtk/.
*/
#include "config.h"
if (handle_ht)
data = g_hash_table_lookup (handle_ht, &handle);
-
+
return data;
}
* Modified by the GTK+ Team and others 1997-2000. See the AUTHORS
* file for a list of people on the GTK+ Team. See the ChangeLog
* files for a list of changes. These files are distributed with
- * GTK+ at ftp://ftp.gtk.org/pub/gtk/.
+ * GTK+ at ftp://ftp.gtk.org/pub/gtk/.
*/
#ifndef __GDK_WIN32_SCREEN_H__
* Modified by the GTK+ Team and others 1997-2000. See the AUTHORS
* file for a list of people on the GTK+ Team. See the ChangeLog
* files for a list of changes. These files are distributed with
- * GTK+ at ftp://ftp.gtk.org/pub/gtk/.
+ * GTK+ at ftp://ftp.gtk.org/pub/gtk/.
*/
#ifndef __GDK_WIN32_WINDOW_H__
* Modified by the GTK+ Team and others 1997-2000. See the AUTHORS
* file for a list of people on the GTK+ Team. See the ChangeLog
* files for a list of changes. These files are distributed with
- * GTK+ at ftp://ftp.gtk.org/pub/gtk/.
+ * GTK+ at ftp://ftp.gtk.org/pub/gtk/.
*/
#include "config.h"
"GdkWindowImplWin32",
&object_info, 0);
}
-
+
return object_type;
}
{
GdkWindow *wrapper;
GdkWindowImplWin32 *window_impl;
-
+
g_return_if_fail (GDK_IS_WINDOW_IMPL_WIN32 (object));
window_impl = GDK_WINDOW_IMPL_WIN32 (object);
-
+
wrapper = window_impl->wrapper;
if (!GDK_WINDOW_DESTROYED (wrapper))
GdkWindowImplWin32 *impl_win32;
g_assert (_gdk_root == NULL);
-
+
_gdk_root = _gdk_display_create_window (_gdk_display);
window = (GdkWindow *)_gdk_root;
/* RegisterGdkClass
* is a wrapper function for RegisterWindowClassEx.
- * It creates at least one unique class for every
+ * It creates at least one unique class for every
* GdkWindowType. If support for single window-specific icons
* is ever needed (e.g Dialog specific), every such window should
* get its own class
static ATOM klassTEMPSHADOW = 0;
static HICON hAppIcon = NULL;
static HICON hAppIconSm = NULL;
- static WNDCLASSEXW wcl;
+ static WNDCLASSEXW wcl;
ATOM klass = 0;
wcl.cbSize = sizeof (WNDCLASSEX);
wcl.hIcon = CopyIcon (hAppIcon); \
wcl.hIconSm = CopyIcon (hAppIconSm); \
wcl.hbrBackground = NULL; \
- wcl.hCursor = LoadCursor (NULL, IDC_ARROW);
-
+ wcl.hCursor = LoadCursor (NULL, IDC_ARROW);
+
switch (wtype)
{
case GDK_WINDOW_TOPLEVEL:
}
klass = klassTOPLEVEL;
break;
-
+
case GDK_WINDOW_CHILD:
if (0 == klassCHILD)
{
wcl.lpszClassName = L"gdkWindowChild";
-
+
/* XXX: Find out whether GL Widgets are done for GDK_WINDOW_CHILD
* MSDN says CS_PARENTDC should not be used for GL Context
* creation
}
klass = klassCHILD;
break;
-
+
case GDK_WINDOW_TEMP:
if ((wtype_hint == GDK_WINDOW_TYPE_HINT_MENU) ||
(wtype_hint == GDK_WINDOW_TYPE_HINT_DROPDOWN_MENU) ||
klass = klassTEMP;
}
break;
-
+
default:
g_assert_not_reached ();
break;
}
-
+
if (klass == 0)
{
WIN32_API_FAILED ("RegisterClassExW");
* is used.
*
* The visual parameter, is based on GDK_WA_VISUAL if set already.
- * From attributes the only things used is: colormap, title,
+ * From attributes the only things used is: colormap, title,
* wmclass and type_hint. [1]. We are checking redundant information
* and complain if that changes, which would break this implementation
* again.
title = "";
impl->native_event_mask = GDK_STRUCTURE_MASK | event_mask;
-
+
if (attributes_mask & GDK_WA_TYPE_HINT)
gdk_window_set_type_hint (window, attributes->type_hint);
klass = RegisterGdkClass (window->window_type, impl->type_hint);
wtitle = g_utf8_to_utf16 (title, -1, NULL, NULL, NULL);
-
+
hwndNew = CreateWindowExW (dwExStyle,
MAKEINTRESOURCEW (klass),
wtitle,
hwndNew);
/* HB: IHMO due to a race condition the handle was increased by
- * one, which causes much trouble. Because I can't find the
+ * one, which causes much trouble. Because I can't find the
* real bug, try to workaround it ...
* To reproduce: compile with MSVC 5, DEBUG=1
*/
title,
window_width, window_height,
window->x - offset_x,
- window->y - offset_y,
+ window->y - offset_y,
hparent,
GDK_WINDOW_HWND (window)));
impl = GDK_WINDOW_IMPL_WIN32 (window->impl);
impl->wrapper = window;
parent = GetParent (anid);
-
+
window->parent = gdk_win32_handle_table_lookup (parent);
if (!window->parent || GDK_WINDOW_TYPE (window->parent) == GDK_WINDOW_FOREIGN)
window->parent = _gdk_root;
-
+
window->parent->children = g_list_prepend (window->parent->children, window);
window->parent->impl_window->native_children =
g_list_prepend (window->parent->impl_window->native_children, window);
GSList *tmp;
g_return_if_fail (GDK_IS_WINDOW (window));
-
+
GDK_NOTE (MISC, g_print ("gdk_win32_window_destroy: %p\n",
GDK_WINDOW_HWND (window)));
*/
gdk_window_hide (window);
gdk_window_reparent (window, NULL, 0, 0);
-
+
PostMessage (GDK_WINDOW_HWND (window), WM_CLOSE, 0, 0);
}
_gdk_window_destroy (window, TRUE);
}
-
+
gdk_win32_handle_table_remove (GDK_WINDOW_HWND (window));
g_object_unref (window);
}
rect->left = rect->top = 0;
rect->right = width;
rect->bottom = height;
-
+
_gdk_win32_adjust_client_rect (window, rect);
}
*x -= (outer_rect->right - outer_rect->left) / 2;
*x += window->width / 2;
break;
-
+
case GDK_GRAVITY_SOUTH_EAST:
case GDK_GRAVITY_EAST:
case GDK_GRAVITY_NORTH_EAST:
GDK_WINDOW_HWND (window),
_gdk_win32_window_state_to_string (window->state),
(deiconify ? " deiconify" : "")));
-
+
/* If asked to show (not deiconify) an withdrawn and iconified
* window, do that.
*/
if (!deiconify &&
!already_mapped &&
(window->state & GDK_WINDOW_STATE_ICONIFIED))
- {
+ {
ShowWindow (GDK_WINDOW_HWND (window), SW_SHOWMINNOACTIVE);
return;
}
-
+
/* If asked to just show an iconified window, do nothing. */
if (!deiconify && (window->state & GDK_WINDOW_STATE_ICONIFIED))
return;
-
+
/* If asked to deiconify an already noniconified window, do
* nothing. (Especially, don't cause the window to rise and
* activate. There are different calls for that.)
*/
if (deiconify && !(window->state & GDK_WINDOW_STATE_ICONIFIED))
return;
-
+
/* If asked to show (but not raise) a window that is already
* visible, do nothing.
*/
return;
/* Other cases */
-
+
if (!already_mapped)
focus_on_map = window->focus_on_map;
}
/* For initial map of "normal" windows we want to emulate WM window
- * positioning behaviour, which means:
+ * positioning behaviour, which means:
* + Use user specified position if GDK_HINT_POS or GDK_HINT_USER_POS
* otherwise:
* + default to the initial CW_USEDEFAULT placement,
}
static void
-gdk_win32_window_show (GdkWindow *window,
+gdk_win32_window_show (GdkWindow *window,
gboolean already_mapped)
{
show_window_internal (window, FALSE, FALSE);
GDK_NOTE (MISC, g_print ("gdk_win32_window_hide: %p: %s\n",
GDK_WINDOW_HWND (window),
_gdk_win32_window_state_to_string (window->state)));
-
+
if (GDK_WINDOW_IS_MAPPED (window))
gdk_synthesize_window_state (window,
0,
GDK_WINDOW_STATE_WITHDRAWN);
-
+
_gdk_window_clear_update_area (window);
-
+
if (GDK_WINDOW_TYPE (window) == GDK_WINDOW_TOPLEVEL)
ShowOwnedPopups (GDK_WINDOW_HWND (window), FALSE);
-
+
if (GetWindowLong (GDK_WINDOW_HWND (window), GWL_EXSTYLE) & WS_EX_TRANSPARENT)
{
SetWindowPos (GDK_WINDOW_HWND (window), HWND_BOTTOM,
window_impl = GDK_WINDOW_IMPL_WIN32 (window->impl);
window_impl->inhibit_configure = TRUE;
- /* We ignore changes to the window being moved or resized by the
+ /* We ignore changes to the window being moved or resized by the
user, as we don't want to fight the user */
if (GDK_WINDOW_HWND (window) == _modal_move_resize_window)
goto out;
API_CALL (SetParent, (GDK_WINDOW_HWND (window),
GDK_WINDOW_HWND (new_parent)));
-
+
API_CALL (MoveWindow, (GDK_WINDOW_HWND (window),
x, y, window->width, window->height, TRUE));
*/
if (GDK_WINDOW_TYPE (new_parent) == GDK_WINDOW_FOREIGN)
new_parent = _gdk_root;
-
+
window->parent = new_parent;
/* Switch the window type as appropriate */
g_return_if_fail (GDK_IS_WINDOW (window));
g_return_if_fail (GDK_WINDOW_TYPE (window) != GDK_WINDOW_CHILD);
-
+
if (GDK_WINDOW_DESTROYED (window))
return;
flashwinfo.dwFlags = FLASHW_STOP;
flashwinfo.uCount = 0;
flashwinfo.dwTimeout = 0;
-
+
flashWindowEx (&flashwinfo);
}
else
if (gdk_window_get_decorations (window, decoration))
return TRUE;
-
- if (window->window_type != GDK_WINDOW_TOPLEVEL)
+
+ if (window->window_type != GDK_WINDOW_TOPLEVEL)
{
return FALSE;
}
*decoration = (GDK_DECOR_ALL | GDK_DECOR_RESIZEH | GDK_DECOR_MENU |
GDK_DECOR_MINIMIZE | GDK_DECOR_MAXIMIZE);
return TRUE;
-
+
case GDK_WINDOW_TYPE_HINT_DOCK:
return FALSE;
-
+
case GDK_WINDOW_TYPE_HINT_DESKTOP:
return FALSE;
return TRUE;
}
}
-
+
return FALSE;
}
FullscreenInfo *fi;
g_return_if_fail (GDK_IS_WINDOW (window));
-
+
if (GDK_WINDOW_DESTROYED (window))
return;
GDK_NOTE (MISC, g_print ("... MIN_SIZE: %dx%d\n",
geometry->min_width, geometry->min_height));
}
-
+
if (geom_mask & GDK_HINT_MAX_SIZE)
{
GDK_NOTE (MISC, g_print ("... MAX_SIZE: %dx%d\n",
GDK_NOTE (MISC, g_print ("... BASE_SIZE: %dx%d\n",
geometry->base_width, geometry->base_height));
}
-
+
if (geom_mask & GDK_HINT_RESIZE_INC)
{
GDK_NOTE (MISC, g_print ("... RESIZE_INC: (%d,%d)\n",
geometry->width_inc, geometry->height_inc));
}
-
+
if (geom_mask & GDK_HINT_ASPECT)
{
GDK_NOTE (MISC, g_print ("... ASPECT: %g--%g\n",
/* Empty window titles not allowed, so set it to just a period. */
if (!title[0])
title = ".";
-
+
GDK_NOTE (MISC, g_print ("gdk_window_set_title: %p: %s\n",
GDK_WINDOW_HWND (window), title));
-
+
GDK_NOTE (MISC_OR_EVENTS, title = g_strdup_printf ("%p %s", GDK_WINDOW_HWND (window), title));
wtitle = g_utf8_to_utf16 (title, -1, NULL, NULL, NULL);
const gchar *role)
{
g_return_if_fail (GDK_IS_WINDOW (window));
-
+
GDK_NOTE (MISC, g_print ("gdk_window_set_role: %p: %s\n",
GDK_WINDOW_HWND (window),
(role ? role : "NULL")));
}
static void
-gdk_win32_window_set_transient_for (GdkWindow *window,
+gdk_win32_window_set_transient_for (GdkWindow *window,
GdkWindow *parent)
{
HWND window_id, parent_id;
GdkWin32Cursor *cursor_private;
HCURSOR hcursor;
HCURSOR hprevcursor;
-
+
impl = GDK_WINDOW_IMPL_WIN32 (window->impl);
cursor_private = (GdkWin32Cursor*) cursor;
-
+
if (GDK_WINDOW_DESTROYED (window))
return;
hcursor = NULL;
else
hcursor = cursor_private->hcursor;
-
+
GDK_NOTE (MISC, g_print ("gdk_win32_window_set_cursor: %p: %p\n",
GDK_WINDOW_HWND (window),
hcursor));
{
if (!window)
window = _gdk_root;
-
+
if (!GDK_WINDOW_DESTROYED (window))
{
RECT rect;
ClientToScreen (GDK_WINDOW_HWND (window), &pt);
tx = pt.x;
ty = pt.y;
-
+
if (root_x)
*root_x = tx + _gdk_offset_x;
if (root_y)
rect->y = 0;
rect->width = 1;
rect->height = 1;
-
+
if (GDK_WINDOW_DESTROYED (window))
return;
GDK_DEVICE_GET_CLASS (device)->warp (device, screen, x, y);
}
-static GdkEventMask
+static GdkEventMask
gdk_win32_window_get_events (GdkWindow *window)
{
GdkWindowImplWin32 *impl;
return impl->native_event_mask;
}
-static void
+static void
gdk_win32_window_set_events (GdkWindow *window,
GdkEventMask event_mask)
{
CombineRgn (hrgn, hrgn, tmp, RGN_OR);
DeleteObject (tmp);
}
-
+
SetWindowRgn (GDK_WINDOW_HWND (window), hrgn, TRUE);
}
}
static void
-gdk_win32_window_set_icon_name (GdkWindow *window,
+gdk_win32_window_set_icon_name (GdkWindow *window,
const gchar *name)
{
/* In case I manage to confuse this again (or somebody else does):
if (GDK_WINDOW_DESTROYED (window))
return;
-
+
#if 0
/* This is not the correct thing to do. We should keep both the
* "normal" window title, and the icon name. When the window is
if (GDK_WINDOW_DESTROYED (window))
return NULL;
-
+
g_warning ("gdk_window_get_group not yet implemented");
return NULL;
}
static void
-gdk_win32_window_set_group (GdkWindow *window,
+gdk_win32_window_set_group (GdkWindow *window,
GdkWindow *leader)
{
g_return_if_fail (GDK_IS_WINDOW (window));
if (GDK_WINDOW_DESTROYED (window) || GDK_WINDOW_DESTROYED (leader))
return;
-
+
g_warning ("gdk_window_set_group not implemented");
}
GDK_WINDOW_HWND (window),
_gdk_win32_window_style_to_string (old_style),
_gdk_win32_window_style_to_string (new_style)));
-
+
SetWindowLong (GDK_WINDOW_HWND (window), GWL_STYLE, new_style);
}
GDK_WINDOW_HWND (window),
_gdk_win32_window_exstyle_to_string (old_exstyle),
_gdk_win32_window_exstyle_to_string (new_exstyle)));
-
+
SetWindowLong (GDK_WINDOW_HWND (window), GWL_EXSTYLE, new_exstyle);
}
SetWindowPos (GDK_WINDOW_HWND (window), NULL,
rect.left, rect.top,
rect.right - rect.left, rect.bottom - rect.top,
- SWP_FRAMECHANGED | SWP_NOACTIVATE |
+ SWP_FRAMECHANGED | SWP_NOACTIVATE |
SWP_NOREPOSITION | SWP_NOZORDER);
}
get_decorations_quark ()
{
static GQuark quark = 0;
-
+
if (!quark)
quark = g_quark_from_static_string ("gdk-window-decorations");
-
+
return quark;
}
GdkWMDecoration decorations)
{
GdkWMDecoration* decorations_copy;
-
+
g_return_if_fail (GDK_IS_WINDOW (window));
-
+
GDK_NOTE (MISC, g_print ("gdk_window_set_decorations: %p: %s %s%s%s%s%s%s\n",
GDK_WINDOW_HWND (window),
(decorations & GDK_DECOR_ALL ? "clearing" : "setting"),
GdkWMDecoration *decorations)
{
GdkWMDecoration* decorations_set;
-
+
g_return_val_if_fail (GDK_IS_WINDOW (window), FALSE);
decorations_set = g_object_get_qdata (G_OBJECT (window), get_decorations_quark ());
get_functions_quark ()
{
static GQuark quark = 0;
-
+
if (!quark)
quark = g_quark_from_static_string ("gdk-window-functions");
-
+
return quark;
}
GdkWMFunction* functions_copy;
g_return_if_fail (GDK_IS_WINDOW (window));
-
+
GDK_NOTE (MISC, g_print ("gdk_window_set_functions: %p: %s %s%s%s%s%s\n",
GDK_WINDOW_HWND (window),
(functions & GDK_FUNC_ALL ? "clearing" : "setting"),
GdkWMFunction *functions)
{
GdkWMFunction* functions_set;
-
+
functions_set = g_object_get_qdata (G_OBJECT (window), get_functions_quark ());
if (functions_set)
*functions = *functions_set;
guint32 timestamp)
{
WPARAM winedge;
-
+
g_return_if_fail (GDK_IS_WINDOW (window));
-
+
if (GDK_WINDOW_DESTROYED (window))
return;
*/
if (button != 1)
return;
-
+
/* Must break the automatic grab that occured when the button was
* pressed, otherwise it won't work.
*/
guint32 timestamp)
{
g_return_if_fail (GDK_IS_WINDOW (window));
-
+
if (GDK_WINDOW_DESTROYED (window))
return;
*/
if (button != 1)
return;
-
+
/* Must break the automatic grab that occured when the button was pressed,
* otherwise it won't work.
*/
_gdk_win32_window_state_to_string (window->state)));
if (GDK_WINDOW_IS_MAPPED (window))
- {
+ {
show_window_internal (window, GDK_WINDOW_IS_MAPPED (window), TRUE);
}
else
/* Send state change before configure event */
gdk_synthesize_window_state (window, 0, GDK_WINDOW_STATE_FULLSCREEN);
- SetWindowLong (GDK_WINDOW_HWND (window), GWL_STYLE,
+ SetWindowLong (GDK_WINDOW_HWND (window), GWL_STYLE,
(fi->style & ~WS_OVERLAPPEDWINDOW) | WS_POPUP);
API_CALL (SetWindowPos, (GDK_WINDOW_HWND (window), HWND_TOP,
fi->r.left, fi->r.top,
fi->r.right - fi->r.left, fi->r.bottom - fi->r.top,
SWP_NOCOPYBITS | SWP_SHOWWINDOW));
-
+
g_object_set_data (G_OBJECT (window), "fullscreen-info", NULL);
g_free (fi);
update_style_bits (window);
if (GDK_WINDOW_DESTROYED (window))
return;
-
+
GDK_NOTE (MISC, g_print ("gdk_window_focus: %p: %s\n",
GDK_WINDOW_HWND (window),
_gdk_win32_window_state_to_string (window->state)));
gboolean modal)
{
g_return_if_fail (GDK_IS_WINDOW (window));
-
+
if (GDK_WINDOW_DESTROYED (window))
return;
#if 0
/* Not sure about this one.. -- Cody */
if (GDK_WINDOW_IS_MAPPED (window))
- API_CALL (SetWindowPos, (GDK_WINDOW_HWND (window),
+ API_CALL (SetWindowPos, (GDK_WINDOW_HWND (window),
modal ? HWND_TOPMOST : HWND_NOTOPMOST,
0, 0, 0, 0,
SWP_NOMOVE | SWP_NOSIZE));
#if 0 /* Should we also turn off the minimize and maximize buttons? */
SetWindowLong (GDK_WINDOW_HWND (window), GWL_STYLE,
GetWindowLong (GDK_WINDOW_HWND (window), GWL_STYLE) & ~(WS_MINIMIZEBOX|WS_MAXIMIZEBOX|WS_SYSMENU));
-
+
SetWindowPos (GDK_WINDOW_HWND (window), NULL,
0, 0, 0, 0,
SWP_FRAMECHANGED | SWP_NOACTIVATE | SWP_NOMOVE |
GdkWindowTypeHint hint)
{
g_return_if_fail (GDK_IS_WINDOW (window));
-
+
if (GDK_WINDOW_DESTROYED (window))
return;
gdk_win32_window_get_type_hint (GdkWindow *window)
{
g_return_val_if_fail (GDK_IS_WINDOW (window), GDK_WINDOW_TYPE_HINT_NORMAL);
-
+
if (GDK_WINDOW_DESTROYED (window))
return GDK_WINDOW_TYPE_HINT_NORMAL;
for (i = 0; i < nrects; i++)
{
rect = ((RECT *) rgndata->Buffer) + rgndata->rdh.nCount++;
-
+
cairo_region_get_rectangle (region, i, &r);
rect->left = r.x + x_origin;
rect->right = rect->left + r.width;
HRGN hrgn;
hrgn = cairo_region_to_hrgn (shape_region, 0, 0);
-
+
GDK_NOTE (MISC, g_print ("gdk_win32_window_shape_combine_region: %p: %p\n",
GDK_WINDOW_HWND (window),
hrgn));
GWL_EXSTYLE,
exstyle | WS_EX_LAYERED);
- setLayeredWindowAttributes =
+ setLayeredWindowAttributes =
(PFN_SetLayeredWindowAttributes)GetProcAddress (GetModuleHandle ("user32.dll"), "SetLayeredWindowAttributes");
if (setLayeredWindowAttributes)
/**
* _gdk_win32_acquire_dc
* @impl: a Win32 #GdkWindowImplWin32 implementation
- *
+ *
* Gets a DC with the given drawable selected into it.
*
* Returns: The DC, on success. Otherwise
* _gdk_win32_impl_release_dc() must be called
* release the DC when you are done using it.
**/
-static HDC
+static HDC
_gdk_win32_impl_acquire_dc (GdkWindowImplWin32 *impl)
{
if (GDK_IS_WINDOW_IMPL_WIN32 (impl) &&
/**
* _gdk_win32_impl_release_dc
* @impl: a Win32 #GdkWindowImplWin32 implementation
- *
+ *
* Releases the reference count for the DC
* from _gdk_win32_impl_acquire_dc()
**/
GDI_CALL (SelectObject, (impl->hdc, impl->saved_dc_bitmap));
impl->saved_dc_bitmap = NULL;
}
-
+
if (impl->hdc)
{
GDI_CALL (ReleaseDC, (impl->handle, impl->hdc));
parent_class = g_type_class_peek_parent (klass);
object_class->finalize = gdk_window_impl_win32_finalize;
-
+
impl_class->ref_cairo_surface = gdk_win32_ref_cairo_surface;
impl_class->show = gdk_win32_window_show;
* Modified by the GTK+ Team and others 1997-1999. See the AUTHORS
* file for a list of people on the GTK+ Team. See the ChangeLog
* files for a list of changes. These files are distributed with
- * GTK+ at ftp://ftp.gtk.org/pub/gtk/.
+ * GTK+ at ftp://ftp.gtk.org/pub/gtk/.
*/
#ifndef __GDK_WINDOW_WIN32_H__
int hdc_count;
HBITMAP saved_dc_bitmap; /* Original bitmap for dc */
};
-
-struct _GdkWindowImplWin32Class
+
+struct _GdkWindowImplWin32Class
{
GdkWindowImplClass parent_class;
};